Contour
Various ways to draw following a shape's border. This is usually called "outline", but it's avoided here since it can very well be drawn in'side. Instructions are given for typical interface layout. Dedicated docks and context menus in them often have shortcuts. Conventions Terms used here : *'border: The precise limit of the shape to follow. *'inside'/'outside': Relative to the border. *'gap': Optional space between the border and the contour. Other conventions here : *'«''Select pixels»': Use whatever method is suitable to get or select the raster to contour. *'«''Get path''»': Use whatever method is suitable to get or select the path to contour. *'«''File►Command''»': Open the "File" menu, select the "Command" item. *'"Pick layer to draw in'" : Either : ** Stay on the same layer. Draw will clobber content. ** Create or re-use another layer, place it above or under the shape's layer, and select it. Draw will leave shape untouched, and may be modified independently. *'«Fill or paint'» : Use one of «''Edit►Fill»… or click inside the selection with a drawing tool. Path vs Selection (tested using GIMP v2.10.14) Both can be struck, for slightly different results. «''Select►From Path''» or path context menu«''►Path to Selection''» to get a selection from a path. «''Select►To Path''» to get a path from a selection. Caveat: Cuts and rounds through pixel corners, ending smaller than the original shape and significantly off-shape for small details. Case of text layers (tested using GIMP v2.10.14) Layer's context menu►«''Alpha to Selection''» to obtain selection. «''Layer►Text to Path''» to obtain path. Drawing on a text layer turns it into a special raster layer, making the text unavailable. Clicking with the "Text" tool on such a layer offers to discard the draw changes or copy text to a new layer to recover original text. «''Antialiasing''» on "Text" tool mixes badly with selection and contouring, especially at small sizes. Methods By Selection Fill (tested using GIMP v2.10.14) #Select pixels. #«''Select►Grow…''» or «''►Shrink…''» by how much the contour must extend out or gap in the border… Caveat: Loses the original anti-aliasing. #*Grow > Width : Outside the border with gap of Grow-Width. #*Grow = Width : Right outside the border #*Grow = Width÷2 : Straddling the border. #*No Grow : Right inside the border. #*Shrink : Inside the border with that gap. #«''Select►Border…''» by how wide the contour must be. Set «''Border style''» to… #*«''Smooth''» to round outside corners. #*«''Feathered''» to round corners even more and anti-alias, on both sides. #Fill or paint. By Selection Stroke (tested using GIMP v2.10.14) #Select pixels. #Either… #*No change to draw inside. #*«''Select►Invert''» to draw outside. #Pick layer to draw in. #«''Edit►Stroke Selection…''» then either of… #*Choose «''Stroke line''», set «''Solid''», «''Antialiasing«'', «''Line width''» to intended outline width×2. Caveat: The contour is squarish and solid fill. Reduce width by 1 (anything from 0 to 2 both excluded in fact) to anti-alias the outermost pixel. This makes a 1-2px contour sufficiently smooth. #*«''Stroke with a paint tool''», after setting the tool's «''Size''» to intended outline width×2. Bug: Shifts half a pixel to the bottom right. (very noticeable under a few pixels of width) Caveat: Tight spaces may get painted twice. (can be bad for transparency) Bug: Stroking on a different layer ignores selection limit as of GIMP v2.10.14. By Path Stroke (tested using GIMP v2.10.14) Like Selection Stroke above, except : * Select and stroke path instead of selection. * The stroke straddles the border, and intended width should be doubled. Adding a selection will do as Selection Stroke above, but then this makes using a path pointless.